package com.cy.utils;

/**
 * @Author ChenYan
 * @Date 2021/8/13 13:29
 * @Description
 */
public class HttpProtocolUtil {

    public static String getHttpHeader200(long contentLength){
         return "HTTP/1.1 200 OK \n" +
                 "Content-Type: text/html;charset=utf-8\n" +
                 "Content-Length: " + contentLength + "\n" +
                 "\r\n";
    }

    public static String getHttpHeader404(){
        String str404 = "404 not found";
        return "HTTP/1.1 404 NOT Found \n" +
                "Content-Type: text/html;charset=utf-8\n" +
                "Content-Length: " + str404.getBytes().length + "\n" +
                "\r\n";
    }
}
